package com.magima.utils.audio;

import android.content.Context;

public class VoiceRecognizer {
	public interface VoiceRecognizeTool {
		public void init(Context context);
		public void showRecognizerDialog(Context context);
		public void setInterface(OnVoiceSearchListener callback);
		public void setAppId(String appId);
	}
	
	public interface OnVoiceSearchListener{
		void onEnd(String results);
	}
	
	private static VoiceRecognizeTool tool;
	
	public static void setRecognizeImplement(VoiceRecognizeTool t){
		tool = t;
	}
	
	public static VoiceRecognizeTool getImplement(){
		return tool;
	}
	
	public static void init(Context context){
		if ( tool != null )
			tool.init(context);
	}
	
	public static void showRecognizerDialog(Context context){
		if ( tool != null )
			tool.showRecognizerDialog(context);
	}
	
	public static void setInterface(OnVoiceSearchListener callback){
		if ( tool != null )
			tool.setInterface(callback);
	}
	
	public static void setAppId(String appId){
		if ( tool != null )
			tool.setAppId(appId);
	}
}
